/*
 * socket_base.h
 *
 *  Created on: 2008-11-29
 *      Author: ant
 */

#ifndef SOCKET_BASE_H_
#define SOCKET_BASE_H_

#include "bits/config.h"
#include <stdint.h>

#if defined(PLATFORM_WIN32)

#include <winsock2.h>

typedef int socklen_t;

BEGIN_NAMESPACE_TOXIC

struct SocketInitializer {
	SocketInitializer();
	~SocketInitializer();
};

END_NAMESPACE_TOXIC

#elif defined(PLATFORM_POSIX)

#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>

#define closesocket close

#else
#error "Socket unavailable on this platform"
#endif

#endif /* SOCKET_BASE_H_ */
